package part_06_Countdown_Latches;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class App0 {

	
	
	public static void main(String[] args) {
	
	CountDownLatch latch =new CountDownLatch(10);
	
	
	ExecutorService executor=Executors.newFixedThreadPool(3);
	
	for (int i = 0; i < 10; i++) {
		executor.submit(new Processor(latch));
	}
	
	try {
		latch.await();
	} catch (InterruptedException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	System.out.println("Process completed");	
}
	
	
}
